<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
  <title>班级列表</title>
  <style>
    /* 全局基础样式 */
    body {
      font-family: Arial, sans-serif;
      line-height: 1.6;
      margin: 0;
      padding: 0;
      background-color: #f8f9fa;
      color: #333;
    }

    /* 表格样式 */
    table {
      width: 80%;
      margin: 40px auto;
      border-collapse: collapse;
      background-color: #fff;
      box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
      overflow: hidden;
    }

    th, td {
      border: 1px solid #e0e0e0;
      padding: 15px;
      text-align: center;
      font-size: 16px;
    }

    th {
      background-color: #007bff;
      color: white;
    }

    tr:nth-child(even) {
      background-color: #f4f6f9;
    }

    tr:hover {
      background-color: #f0f2f5;
      transition: background-color 0.3s ease;
    }

    /* 链接样式 */
    a {
      text-decoration: none;
      color: #007bff;
      margin: 0 8px;
      padding: 8px 15px;
      border-radius: 4px;
      font-size: 16px;
      transition: background-color 0.3s ease, color 0.3s ease;
    }

    a:hover {
      background-color: #007bff;
      color: white;
    }

    /* 按钮样式 */
    button {
      background-color: #dc3545;
      color: white;
      border: none;
      padding: 8px 15px;
      border-radius: 4px;
      cursor: pointer;
      transition: background-color 0.3s ease;
    }

    button:hover {
      background-color: #c82333;
    }
  </style>
</head>
<body>
<h1 style="text-align: center; margin-bottom: 20px;">班级列表</h1>
<table>
  <thead>
  <tr>
    <th>编号</th>
    <th>班级名称</th>
    <th>操作</th>
  </tr>
  </thead>
  <tbody>
  <c:forEach items="${claList}" var="cla">
    <tr>
      <td>${cla.cId}</td>
      <td>${cla.cName}</td>
      <td>
        <a href="getStudentByClaId?cId=${cla.cId}">学生详情</a>
      </td>
    </tr>
  </c:forEach>
  </tbody>
</table>

<script>
  function del(id) {
    if (confirm("确定删除吗？")) {
      location.href = "deleteClaById?id=" + id;
    }
  }
</script>
</body>
</html>
